#!/usr/bin/env bash

pwd_path=$(cd `dirname $0`; pwd)

. ${pwd_path}/config.sh

echo "version: '3'
services:
  mysql:
    build:
      context: mysql5.7
      dockerfile: Dockerfile
    ports:
      - "33061:3306"
    environment:
      - MYSQL_DATABASE=erp
      - MYSQL_ROOT_PASSWORD=111111
    volumes:
      - ./mysql5.7/data:/var/lib/mysql
  redis4:
    build:
      context: redis4.0
      dockerfile: Dockerfile
    ports:
      ${mysql_port}
  php7.2:
    build:
      context: httpd-php7.2
      dockerfile: Dockerfile
    ports:
      ${web_ports}
    tty: true
    volumes:
      - ./httpd-php7.2/nginx/conf.d:/etc/nginx/conf.d
      - ${base_path}:/data

    links:
      - redis4
      - mysql
      - node

#  transcoding:
#    build:
#      context: transcoding
#      dockerfile: Dockerfile
#    volumes:
#      - ${base_path}:/data
#    links:
#      - redis4
#      - mysql

#  mongo4.0:
#    build:
#      context: mongo4.0
#      dockerfile: Dockerfile
#    ports:
#      - 27017:27017
#    volumes:
#      - ./mongo4.0/data:/bitnami

  node:
     build:
       context: node
       dockerfile: Dockerfile
     volumes:
      - ${base_path}:/data
     links:
       - redis4
     ports:
      ${socket_port}
#  swoole:
#    build:
#        context: swoole
#        dockerfile: Dockerfile
#    volumes:
#        - ${base_path}/swoft:/var/www/swoft
#    links:
#        - redis4
#        - mysql
#    ports:
#        - 6100:80
" > docker-compose.yml
